Data transmission method, electronic device, and storage medium

ABSTRACT

Disclosed are a data transmission method, an electronic device, and a storage medium. The data transmission method may include: receiving a message sent by an upstream device, wherein the message carries first information for indicating an outbound interface and second information for indicating a period value; acquiring a reception sub-period label according to a time of arrival of the message and the second information, wherein the reception sub-period label is used for indicating a sequential position of a reception sub-period used when the message is received in an entire reception period, and the reception period comprises a plurality of reception sub-periods; and sending the message according to the reception sub-period label and the first information.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a national stage filing under 35 U.S.C. § 371 ofinternational application number PCT/CN2021/118536, filed Sep. 15, 2021,which claims priority to Chinese patent application No. 202011550526.9,filed Dec. 24, 2020. The contents of these applications are incorporatedherein by reference in their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field ofcommunication, and more particularly, to a data transmission method, anelectronic device, and a storage medium.

BACKGROUND

Deterministic Networking (DetNet) is a technology of providingdeterministic service guarantee capabilities to services borne in anetwork domain. These deterministic service guarantee capabilitiesinclude delay, delay jitter, packet loss rate, and other indicators. Toensure a delay jitter in an end-to-end transmission of a message in anasynchronous mode, a source device needs to add time period labelinformation of an upstream device in the message, so that a forwardingdevice, after receiving the message, can find forwarding sub-periodlabel information of an outbound interface in a fixed mappingrelationship table of inbound interface labels and outbound interfacelabels according to the time period label information of the upstreamdevice carried in the message and an outbound interface numberdetermined according to address information carried in the message.Then, the forwarding device replaces original time label information inthe message with the forwarding sub-period label information to generatea new message, and finally forwards the new message through thecorresponding outbound interface according to a forwarding sub-periodindicated by the forwarding sub-period label information.

However, an original message in a protocol does not contain time periodlabel information, and the protocol needs to be extended in order to addtime period label information in the message. In addition, the messageneeds to be modified to replace the time label information in theoriginal message with forwarding sub-period label information, makingthe operations more complicated and more resource-consuming.

SUMMARY

An embodiment of the present disclosure provides a data transmissionmethod. The method includes the following steps: receiving a messagesent by an upstream device, the message carries first information forindicating an outbound interface and second information for indicating aperiod value; acquiring a reception sub-period label according to a timeof arrival of the message and the second information; and sending themessage according to the reception sub-period label and the firstinformation.

An embodiment of the present disclosure further provides an electronicdevice. The electronic device includes: at least one processor; and amemory communicably connected to the at least one processor, the memorystores instructions executable by the at least one processor which, whenexecuted by the at least one processor, causes the at least oneprocessor to implement the above data transmission method.

An embodiment of the present disclosure further provides acomputer-readable storage medium, storing a computer program which, whenexecuted by a processor, causes the processor to implement the abovedata transmission method.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flowchart of a data transmission method according to a firstembodiment of the present disclosure;

FIG. 2 is a flowchart of step S102 in the data transmission methodaccording to the first embodiment of the present disclosure shown inFIG. 1 ;

FIG. 3 is a flowchart of a data transmission method according to asecond embodiment of the present disclosure;

FIG. 4 is a flowchart of a data transmission method according to a thirdembodiment of the present disclosure;

FIG. 5 is a flowchart of a data transmission method according to afourth embodiment of the present disclosure;

FIG. 6 shows an application scenario of a data transmission methodaccording to a fourth embodiment of the present disclosure;

FIG. 7 is a flowchart of a data transmission method according to a fifthembodiment of the present disclosure;

FIG. 8 is a flowchart of a data transmission method according to a sixthembodiment of the present disclosure; and

FIG. 9 is a schematic structural diagram of an electronic deviceaccording to a seventh embodiment of the present disclosure.

DETAILED DESCRIPTION

A main objective of embodiments of the present disclosure is to providea data transmission method, an electronic device, and a storage medium,to implement data transmission in an asynchronous mode without extendinga protocol or modifying a message.

A first embodiment of the present disclosure relates to a datatransmission method applied to a forwarding device. As shown in FIG. 1 ,the method includes the following steps of S101, S102 and S103.

At S101, a message sent by an upstream device is received, where themessage carries first information for indicating an outbound interfaceand second information for indicating a period value.

In this embodiment, the upstream device may be a source device sendingthe message or may be another forwarding device in a forwarding process.The first information includes a destination IP address, a MAC address,etc. The second information includes a stream identification number, apriority, a 6-tuple of a data packet, etc. Elements in the 6-tuple ofthe data packet may include a source IP address, a destination IPaddress, a protocol number, a source port, a destination port, a servicetype, an interface index, etc. The 6-tuple is a tuple formed by sixelements selected from the above elements according to an actualsituation. Certainly, the above is only an example. In practice, thefirst information may further include information included in otherprotocol-specified messages that can be used to indicate the outboundinterface, and the second information may further include informationincluded in other protocol-specified messages that can be used toindicate the period value, which will not be elaborated herein.

At S102, a reception sub-period label is acquired according to a time ofarrival of the message and the second information.

In an embodiment, as shown in FIG. 2 , S102 includes the following stepsof S201 and S202.

At S201, the period value corresponding to the message is determinedaccording to the second information.

At S202, the reception sub-period label is calculated according to theperiod value and the time of arrival.

In this embodiment, the reception sub-period label is calculated usingthe following formula:

${x = {\left\{ {\left\lbrack \frac{t_{arrive} - t_{start}}{T_{n}} \right\rbrack + 1} \right\}\% m_{n}}},$

where T_(n) denotes the period value obtained by executing S201; xdenotes the reception sub-period label and indicates a sequentialposition of a reception sub-period used when the message is received inan entire reception period, and the reception period includes aplurality of reception sub-periods; t_(start) denotes a preset value,which may be a moment corresponding to a local clock when the device isstarted; t_(arrive) denotes the time of arrival; m_(n) denotes aquantity of reception sub-periods included in the reception perioddetermined according to T_(n); [ ] in the formula denotes a roundingsign; and % denotes a remainder sign.

At S103, the message is sent according to the reception sub-period labeland the first information.

In this embodiment, first, a forwarding sub-period label may need to bedetermined according to the reception sub-period label, then aforwarding sub-period is determined according to the forwardingsub-period label, and finally in the forwarding sub-period, the messageis sent out from the outbound interface determined according to thefirst information.

In the embodiment of the present disclosure, after a message withoutadding time period label information of the upstream device is receivedfrom the upstream device, a reception sub-period label is acquiredaccording to a time of arrival of the message and second informationused for indicating a period value and carried in the message, andfinally the message is directly sent out according to the receptionsub-period label and first information used for indicating an outboundinterface and carried in the message. Because time label information ofthe upstream device is not carried in the message, only the secondinformation in the message and the time of arrival of the message mayneed to be extracted to calculate a reception sub-period of a currentdevice to replace the time label information of the upstream device.Further, there may be no need to update the time label information dueto a change of the upstream device before forwarding the time labelinformation to a downstream device, so that data transmission can beimplemented in an asynchronous mode without extending a protocol ormodifying the message.

A second embodiment of the present disclosure relates to a datatransmission method. This embodiment is substantially the same as thefirst embodiment, except that a local period mapping table may need tobe generated. As shown in FIG. 3 , the method includes the followingsteps of S301, S302, S303, S304, S305, S306, S307, S308 and S309.

At S301, a period generation policy is set.

In this embodiment, the period generation policy is to acquire a periodvalue according to second information. Because the second informationmay be a stream identification number, a 6-tuple of a data packet, apriority, etc., the period generation policy may be to acquire a periodvalue according to the stream identification number, acquire a periodvalue according to the 6-tuple of the packet, acquire a period valueaccording to the priority, etc. Certainly, the above is only an example.In practice, the period generation policy may further include otherinformation, which will not be elaborated herein.

At S302, at least one period value is acquired according to the periodgeneration policy.

At S303, a local period mapping table is generated according to theperiod value and stored.

At S304, a message sent by an upstream device is received, where themessage carries first information for indicating an outbound interfaceand second information for indicating a period value.

S304 in this embodiment is substantially the same as S101 in the firstembodiment, so the details will not be elaborated herein.

It should be noted that the second information in S304 may need to beconsistent with the second information used in the period generationpolicy in S301. If the period generation policy is to acquire the periodvalue according to the stream identification number, the streamidentification number carried in the message may need to be extracted asthe second information in S304.

At S305, a reception sub-period label is acquired according to a time ofarrival of the message and the second information.

S305 in this embodiment is substantially the same as S102 in the firstembodiment, so the details will not be elaborated herein.

At S306, an inbound interface used when the message arrives is recorded.

At S307, the outbound interface is determined according to the firstinformation.

At S308, a forwarding sub-period label is searched for in the localperiod mapping table according to the reception sub-period label, theinbound interface, and the outbound interface.

At S309, the message is sent out from the outbound interface in theforwarding sub-period indicated by the forwarding sub-period label.

It should be noted that the above steps S306 to S309 are a detailedimplementation of S103 in the first embodiment.

In this embodiment, on the basis of setting the period generationpolicy, because one or more period values can be generated according tothe set period generation policy, more than one period value can be usedaccordingly, such that mapping and forwarding in a multi-period scenariocan be supported.

A third embodiment of the present disclosure relates to a datatransmission method. This embodiment is substantially the same as thefirst embodiment, except that a simple calculation is adopted to obtaina forwarding sub-period label. As shown in FIG. 4 , a detailed processincludes the following steps of S401, S402, S403 and S404.

At S401, a message sent by an upstream device is received, where themessage carries first information for indicating an outbound interfaceand second information for indicating a period value.

S401 in this embodiment is substantially the same as S101 in the firstembodiment, so the details will not be elaborated herein.

At S402, a reception sub-period label is acquired according to a time ofarrival of the message and the second information.

S402 in this embodiment is substantially the same as S102 in the firstembodiment, so the details will not be elaborated herein.

At S403, a forwarding sub-period label is calculated according to thereception sub-period label.

In this embodiment, the forwarding sub-period label is calculated by thefollowing formula:

y=(x+i)%m _(n),

where y denotes the forwarding sub-period label, x denotes the receptionsub-period label obtained by executing S402, i denotes a natural numberpreset according to an actual situation, m_(n) denotes a quantity ofreception sub-periods included in the reception period determinedaccording to T_(n), and T_(n) denotes a period value determinedaccording to the period information in S402.

At S404, the message is sent out from the outbound interface indicatedby the first information in the forwarding sub-period indicated by theforwarding sub-period label.

In this embodiment, only a simple calculation may be needed to acquirethe forwarding sub-period label and implement data forwarding, andacquisition and lookup of the local period mapping table are notrequired. By providing a simpler method to acquire the forwardingsub-period, the processing efficiency is improved and storage space issaved.

To enable those having ordinary skills in the art to more clearlyunderstand the overall processes of the data transmission methodsdisclosed in the first to third embodiments of the present disclosure,fourth to sixth embodiments of the present disclosure are describedusing specific application scenarios as examples.

As shown in FIG. 5 , a data transmission method provided by the fourthembodiment of the present disclosure is applied to a data transmissionscenario shown in FIG. 6 , and is described using an example where thesecond information has the priority. The method includes the followingsteps of S501, S502, S503, S504, S505, S506, S507, S508, S509, S510,S511, S512 and S513.

At S501, router 1 and router 2 set a period generation policy asacquiring a period value according to a priority.

At S502, router 1 and router 2 respectively acquire two period valuesaccording to the period generation policy and determine correspondingquantities of sub-periods.

In this embodiment, as shown in FIG. 6 , there are two forwardingdevices in the network, namely, router 1 and router 2, and fournon-forwarding devices, namely, host 1, host 2, host 3, and host 4. Host1 and host 3 are connected to interface 1 and interface 2 of router 1respectively, and host 2 and host 4 are connected to interface 2 andinterface 3 of router 2 respectively. It is assumed that host 1 is asource device of a stream 1 and has a priority of 2, host 2 is adestination device of the stream 1, and the message stream 1 sent byhost 1 arrives at host 2 through router 1 and router 2. It is furtherassumed that host 3 is a source sender of a stream 2 and has a priorityof 3, host 4 is a destination receiver of the stream 2, and the messagestream 2 sent by host 3 arrives at host 4 through router 1 and router 2.Therefore, two period values are generated for priority 2 and priority 3respectively: T1=10 μs and T2=20 μs. The quantity of periodscorresponding to the period value of 10 μs is m1=12, and the quantity ofperiods corresponding to the period value of 20 μs is m2=6.

At S503, router 1 and router 2 respectively generate local periodmapping tables according to the period values.

In this embodiment, the generated local period mapping tables of router1 and router 2 are shown in the following tables.

TABLE 1 Period mapping table of router 1 Inbound Outbound Inboundinterface period Outbound interface period Period interface numberinterface number 10 μs Interface 1 0 Interface 3 6 1 7 2 8 3 9 4 10 5 116 0 7 1 8 2 9 3 10 4 11 5 Interface 2 0 Interface 3 10 1 11 2 0 3 1 4 25 3 6 4 7 5 8 6 9 7 10 8 11 9 20 μs Interface 1 0 Interface 3 3 1 4 2 53 0 4 1 5 2 Interface 2 0 Interface 3 1 1 2 2 3 3 4 4 5 5 0

TABLE 2 Period mapping table of router 2 Inbound Outbound Inboundinterface period Outbound interface period Period interface numberinterface number 10 μs Interface 1 0 Interface 2 3 1 4 2 5 3 6 4 7 5 8 69 7 10 8 11 9 0 10 1 11 2 Interface 1 0 Interface 3 7 1 8 2 9 3 10 4 115 0 6 1 7 2 8 3 9 4 10 5 11 6 20 μs Interface 1 0 Interface 2 1 1 2 2 33 4 4 5 5 0 Interface 1 0 Interface 3 4 1 5 2 0 3 1 4 2 5 3

At S504, router 1 receives the message sent by host 1 and records a timeof arrival of the message and an inbound interface used.

In this embodiment, host 1 sends the source message stream 1, and router1 receives the message and records that a moment at which the messagearrives at interface 1 of router 1 is 145 μs.

At S505, router 1 determines a period value used according to a prioritycarried in the message and determines an outbound interface according tofirst information carried in the message.

In this embodiment, if the priority carried in the message is 2, theperiod value used is 10 μs; and if the first information is an IPaddress of host 2, the outbound interface is interface 3 of router 1.

At S506, router 1 calculates a reception sub-period label of router 1according to the time of arrival of the message and a correspondingquantity of sub-periods.

In this embodiment, if an initial moment of starting of router 1 ispreset to 0 μs, the reception sub-period label of router 1 is:

$x = {{\left\{ {\left\lbrack \frac{\left( {{145{us}} - {0{us}}} \right)}{10{us}} \right\rbrack + 1} \right\}\% 12} = 3.}$

In this case, in this embodiment, the reception sub-period label of themessage arriving at the inbound interface is 3.

At S507, router 1 searches for a forwarding sub-period in the localperiod mapping table of router 1 according to the reception sub-periodlabel of router 1, the inbound interface, and the outbound interface.

In this embodiment, it is determined through steps S504 to S506 that thereception sub-period label is 3, the inbound interface is interface 1 ofrouter 1, and the outbound interface is interface 3 of router 1. In thiscase, it can be learned by looking up Table 1 that the forwardingsub-period label is 9.

At S508, router 1 sends the message to router 2 according to theforwarding sub-period label and the outbound interface.

In this embodiment, router 1 sends the message to router 2 in the ninthforwarding sub-period through interface 3.

At S509, router 2 receives the message sent by router 1 and records atime of arrival of the message and an inbound interface used.

In this embodiment, router 2 receives the message sent by router 1through interface 3 in the ninth sub-period in the period having theperiod value of 10 μs, and records a reception time of 185 μs and theused inbound interface which is interface 1 of router 2.

At S510, router 2 determines a period value used according to a prioritycarried in the message and determines an outbound interface according tofirst information carried in the message.

In this embodiment, if the priority carried in the message is 2, theperiod value to be used is 10 μs; and if the first information is the IPaddress of host 2, the outbound interface is interface 2 of router 2.

At S511, router 2 calculates a reception sub-period label of router 2according to the time of arrival of the message and a correspondingquantity of sub-periods.

In this embodiment, if an initial moment of starting of router 2 ispreset to 0 μs, the reception sub-period label of router 2 is:

$x = {{\left\{ {\left\lbrack \frac{\left( {{185{us}} - {0{us}}} \right)}{10{us}} \right\rbrack + 1} \right\}\% 12} = 7.}$

In this case, in this embodiment, a reception period label of themessage arriving at interface 1 of router 2 is 3.

At S512, router 2 searches for a forwarding sub-period in the localperiod mapping table of router 2 according to the reception sub-periodlabel, the inbound interface, and the outbound interface.

In this embodiment, it is determined through steps S509 to S511 that thereception sub-period label is 7, the inbound interface is interface 1 ofrouter 2, and the outbound interface is interface 2 of router 2. In thiscase, it can be learned by looking up Table 2 that the forwardingsub-period label is 10.

At S513, router 2 sends the message to host 2 according to theforwarding sub-period label of router 2 and the outbound interface.

In this embodiment, router 2 sends the message to host 2 throughinterface 2 in the tenth forwarding sub-period, for host 2 to receiveand use the message.

In the embodiment of the present disclosure, after a message withoutadding time period label information of the upstream device is receivedfrom the upstream device, a reception sub-period label is acquiredaccording to a time of arrival of the message and a priority used forindicating a period value and carried in the message, and finally themessage is directly sent out according to the reception sub-period labeland a destination IP address used for indicating an outbound interfaceand carried in the message. Because time label information of theupstream device is not carried in the message, only the priority in themessage and the time of arrival of the message may need to be extractedto calculate a reception sub-period of a current device to replace thetime label information of the upstream device. Further, there may be noneed to update the time label information due to a change of theupstream device before forwarding the time label information to adownstream device, so that data transmission can be implemented in anasynchronous mode without extending a protocol or modifying the message.In addition, because two period values can be generated according to anactual situation, mapping and forwarding in a multi-period scenario canbe supported.

The fifth embodiment of the present disclosure provides a datatransmission method, which is applied to the application scenario shownin FIG. 6 . As shown in FIG. 7 , the second information is, for example,a 6-tuple of a data packet, and the method includes the following stepsof S701, S702, S703, S704, S705, S706, S707, S708, S709, S710, S711,S712 and S713.

At S701, router 1 and router 2 set a period generation policy asacquiring a period value according to a 6-tuple of a data packet.

At S702, router 1 and router 2 respectively acquire two period valuesaccording to the period generation policy and determine correspondingquantities of sub-periods.

In this embodiment, as shown in FIG. 6 , there are two forwardingdevices in the network, namely, router 1 and router 2, and fournon-forwarding devices, namely, host 1, host 2, host 3, and host 4. Host1 and host 3 are connected to interface 1 and interface 2 of router 1respectively, and host 2 and host 4 are connected to interface 2 andinterface 3 of router 2 respectively. It is assumed that host 1 is asource device of a stream 1 and has a priority of 2, host 2 is adestination device of the stream 1, and the message stream 1 sent byhost 1 arrives at host 2 through router 1 and router 2. It is furtherassumed that host 3 is a source sender of a stream 2 and has a priorityof 3, host 4 is a destination receiver of the stream 2, and the messagestream 2 sent by host 3 arrives at host 4 through router 1 and router 2.Therefore, corresponding periods 20 μs and 40 μs are generated for a6-tuple of stream 1 and a 6-tuple of stream 2 respectively. The quantityof periods corresponding to the period value of 20 μs is m1=4, and thequantity of periods corresponding to the period value of 40 μs is m2=2.

At S703, router 1 and router 2 respectively generate local periodmapping tables according to the period values.

In this embodiment, the generated local period mapping tables of router1 and router 2 are shown in the following tables.

TABLE 3 Period mapping table of router 1 Inbound Outbound Inboundinterface period Outbound interface period Period interface numberinterface number 20 μs Interface 1 0 Interface 3 3 1 0 2 1 3 2 Interface2 0 Interface 3 1 1 2 2 3 3 0 40 μs Interface 1 0 Interface 3 0 1 1Interface 2 0 Interface 3 1 1 0

TABLE 4 Period mapping table of router 2 Inbound Outbound Inboundinterface period Outbound interface period Period interface numberinterface number 20 μs Interface 1 0 Interface 2 2 1 3 2 0 3 1 Interface1 0 Interface 3 3 1 0 2 1 3 2 40 μs Interface 1 0 Interface 2 1 1 0Interface 1 0 Interface 3 1 1 0

At S704, router 1 receives the message sent by host 3 and records a timeof arrival of the message and an inbound interface used.

In this embodiment, host 3 sends the source message stream 2, and router1 receives the message and records that a moment at which the messagearrives at interface 2 of router 1 is 1045 μs.

At S705, router 1 determines a period value used according to a 6-tupleof a data packet corresponding to the message and determines an outboundinterface according to first information carried in the message.

In this embodiment, if the used period value determined according to the6-tuple of the data packet corresponding to the message is 40 μs, andthe first information is an IP address of host 4, the outbound interfaceis interface 3 of router 1.

At S706, router 1 calculates a reception sub-period label of router 1according to the time of arrival of the message and a correspondingquantity of sub-periods.

In this embodiment, if an initial moment of starting of router 1 ispreset to 1000 μis, the reception sub-period label of router 1 is:

$x = {{\left\{ {\left\lbrack \frac{\left( {{1045{us}} - {1000{us}}} \right)}{40{us}} \right\rbrack + 1} \right\}\% 2} = 0.}$

In this case, in this embodiment, the reception sub-period label of themessage arriving at the inbound interface is 3.

At S707, router 1 searches for a forwarding sub-period in the localperiod mapping table of router 1 according to the reception sub-periodlabel of router 1, the inbound interface, and the outbound interface.

In this embodiment, it is determined through steps S704 to S706 that thelocal sub-period label is 0, the inbound interface is interface 2 ofrouter 1, and the outbound interface is interface 3 of router 1. In thiscase, it can be learned by looking up Table 3 that the forwardingsub-period label is 1.

At S708, router 1 sends the message to router 2 according to theforwarding sub-period label and the outbound interface.

In this embodiment, router 1 sends the message to router 2 in the thirdforwarding sub-period through interface 3.

At S709, router 2 receives the message sent by router 1 and records atime of arrival of the message and an inbound interface used.

In this embodiment, router 2 receives the message sent by router 1through interface 3 in the third sub-period in the period having theperiod value of 10 μs, and records a reception time of 1125 μs and theused inbound interface which is interface 1 of router 2.

At S710, router 2 determines a period value used according to a 6-tupleof a data packet corresponding to the message and determines an outboundinterface according to first information carried in the message.

In this embodiment, if the used period value determined according to the6-tuple of the data packet corresponding to the message is 40 μs, andthe first information is the IP address of host 4, the outboundinterface is interface 3 of router 2.

At S711, router 2 calculates a reception sub-period label of router 2according to the time of arrival of the message and a correspondingquantity of sub-periods.

In this embodiment, if an initial moment of starting of router 2 ispreset to 1000 μs, the reception sub-period label of router 2 is:

$x = {{\left\{ {\left\lbrack \frac{\left( {{1125{us}} - {1000{us}}} \right)}{40{us}} \right\rbrack + 1} \right\}\% 2} = 0.}$

In this case, in this embodiment, the reception sub-period label of themessage arriving at the inbound interface is 0.

At S712, router 2 searches for a forwarding sub-period in the localperiod mapping table of router 2 according to the reception sub-periodlabel of router 2, the inbound interface, and the outbound interface.

In this embodiment, it is determined through steps S709 to S711 that thelocal sub-period label is 0, the inbound interface is interface 1 ofrouter 2, and the outbound interface is interface 3 of router 2. In thiscase, it can be learned by looking up Table 2 that the forwardingsub-period label is 1.

At S713, router 2 sends the message to host 2 according to theforwarding sub-period label of router 2 and the outbound interface.

In this embodiment, router 2 sends the message to host 4 throughoutbound interface 3 in the first forwarding sub-period, for host 4 toreceive and use the message.

In the embodiment of the present disclosure, after a message withoutadding time period label information of the upstream device is receivedfrom the upstream device, a reception sub-period label is acquiredaccording to a time of arrival of the message and a 6-tuple of a datapacket used for indicating a period value and carried in the message,and finally the message is directly sent out according to the receptionsub-period label and a destination IP address used for indicating anoutbound interface and carried in the message. Because time labelinformation of the upstream device is not carried in the message, onlythe priority in the message and the time of arrival of the message mayneed to be extracted to calculate a reception sub-period of a currentdevice to replace the time label information of the upstream device.Further, there may be no need to update the time label information dueto a change of the upstream device before forwarding the time labelinformation to a downstream device, so that data transmission can beimplemented in an asynchronous mode without extending a protocol ormodifying the message. In addition, because two period values can begenerated according to an actual situation, mapping and forwarding in amulti-period scenario can be supported.

As shown in FIG. 8 , a data transmission method provided by the sixthembodiment of the present disclosure is described using an example wherethe second information is a stream identification number. The methodincludes the following steps of S801, S802, S803, S804 and S805.

At S801, a message sent by an upstream device is received, where themessage carries first information for indicating an outbound interfaceand a stream identification number for indicating a period value

In this embodiment, the stream identification number carried in themessage is 3.

At S802, a period value used, a quantity of forwarding sub-periods, anda local period mapping policy corresponding to the period value aredetermined according to the stream identification number.

In this embodiment, the period value corresponding to the streamidentification number of 3 obtained by executing S801 is 25 μs, thequantity of forwarding sub-periods is 8, and the local period mappingpolicy is y=(x+1) % 8, where y denotes the forwarding sub-period label,and x denotes the local sub-period label.

It should be noted that the local period mapping policy is a mappingrelationship stored in the device in advance. For example, when theperiod value between the inbound interface 1 and the outbound interface2 is 25 μs, and the quantity of period numbers is 8, the period mappingformula is y=(x+1) % 8. When the period value between the inboundinterface 1 and the outbound interface 3 is 30 μs, and the quantity ofperiod numbers is 6, the period mapping formula is y=(x+2)% 6. Thecorresponding specific mapping relationship can be acquired according tothe determined period. Certainly, the above is only an example. Inpractice, the local period mapping policy may further include othermapping relationships, which will not be elaborated herein.

At S803, a reception sub-period label is acquired according to a time ofarrival of the message and the stream identification number.

In this embodiment, assuming that the time of arrival is 98 μs, thelocal sub-period label can be obtained according to the data acquired inthe above steps as follows:

${x = {{\left\{ {\left\lbrack \frac{\left( {{98{us}} - {40{us}}} \right)}{25{us}} \right\rbrack + 1} \right\}\% 8} = 2}},$

i.e., a local period label of the message arriving at the inboundinterface is 2.

At S804, a forwarding sub-period label is acquired according to thereception sub-period label and the local period mapping policy.

In this embodiment, the forwarding sub-period label is: y=(2+1) % 8=3.

At S805, the message is sent according to the forwarding sub-periodlabel and the first information.

In this embodiment, the message is sent out through the outboundinterface indicated by the first information in the third forwardingsub-period.

In this embodiment, because data forwarding can be implemented throughonly a simple calculation without having to acquire the local periodmapping table, storage space is saved, making the method simpler.

In addition, it should be understood that the division of the steps ofthe above methods is only for the sake of clear description, and inpractical applications, the steps may be combined into one step, or somesteps may be further divided into multiple steps. Such combination ordivision falls within the scope of protection of the present disclosureas long as the same logical relationship is included. Any insignificantmodification made to or any insignificant design introduced in analgorithm or process without changing the core design of the algorithmand process shall fall within the scope of protection of the presentdisclosure.

A seventh embodiment of the present disclosure relates to an electronicdevice. As shown in FIG. 9 , the electronic device includes: at leastone processor 901; and a memory 902 communicably connected to the atleast one processor 901. The memory 902 stores instructions executableby the at least one processor 901 which, when executed by the at leastone processor 901, causes the at least one processor 901 to implementthe data transmission method according to any one of the foregoingmethod embodiments.

The memory 902 and the processor 901 are connected by a bus. The bus mayinclude any number of interconnected buses and bridges. The bus connectsvarious circuits of one or more processors 901 and the memory 902together. The bus may also connect together a peripheral device, avoltage regulator, a power management circuit, and other circuits, whichare well known in the art and therefore will not be detailed herein. Abus interface provides an interface between the bus and a transceiver.The transceiver may be one element or a plurality of elements, forexample, a plurality of receivers and transmitters, and provides a unitfor communicating with various other apparatus over a transmissionmedium. Data processed by the processor 901 is transmitted over awireless medium through an antenna. The antenna further receives dataand transmits the data to the processor 901.

The processor 901 is configured for managing the bus and generalprocessing and may also provide various functions, including timing,peripheral interfaces, voltage regulation, power management and othercontrol functions. The memory 902 may be configured to store data usedby the processor 901 in performing operations.

An eighth embodiment of the present disclosure relates to acomputer-readable storage medium, storing a computer program. Thecomputer program, when executed by a processor, causes the processor toimplement the foregoing method embodiments.

It may be understood by those having ordinary skills in the art that allor some of the steps of the methods in the above embodiments may beperformed by a program instructing related hardware. The program isstored in a storage medium, and includes several instructions to cause adevice (which may be a single chip microcomputer, a chip, etc.) or aprocessor to perform all or some of the steps of the methods describedin the embodiments of the present disclosure. The foregoing storagemedium includes any medium that can store program code, such as a USBflash drive, a removable hard disk, a Read-Only Memory (ROM), a RandomAccess Memory (RAM), a magnetic disk, or an optical disk.

It may be understood by those having ordinary skills in the art that theforegoing embodiments are specific embodiments for practicing thepresent disclosure and that in practical applications, various changesin form and details may be made without departing from the scope of thepresent disclosure.

1. A data transmission method, comprising: receiving a message sent byan upstream device, wherein the message carries first information forindicating an outbound interface and second information for indicating aperiod value; acquiring a reception sub-period label according to a timeof arrival of the message and the second information, wherein thereception sub-period label is used for indicating a sequential positionof a reception sub-period used when the message is received in an entirereception period, and the reception period comprises a plurality ofreception sub-periods; and sending the message according to thereception sub-period label and the first information.
 2. The datatransmission method of claim 1, wherein prior to receiving a messagesent by an upstream device, the method further comprises: setting aperiod generation policy; acquiring at least one period value accordingto the period generation policy; and generating and storing a localperiod mapping table according to the period value.
 3. The datatransmission method of claim 1, wherein sending the message according tothe reception sub-period label and the first information comprises:recording an inbound interface used when the message arrives;determining the outbound interface according to the first information;searching for a forwarding sub-period label in the local period mappingtable according to the reception sub-period label, the inboundinterface, and the outbound interface, wherein the forwarding sub-periodlabel is used for indicating a sequential position of a forwardingsub-period used when the message is forwarded in an entire forwardingperiod, and the forwarding period comprises a plurality of forwardingsub-periods; and sending the message out from the outbound interface inthe forwarding sub-period indicated by the forwarding sub-period label.4. The data transmission method of claim 1, wherein the periodgeneration policy is to acquire the period value according to the secondinformation, and the second information is a stream identificationnumber or a 6-tuple of a data packet or a priority.
 5. The datatransmission method of claim 1, wherein sending the message according tothe reception sub-period label and the first information comprises:calculating the forwarding sub-period label according to the receptionsub-period label; and sending the message out from the outboundinterface indicated by the first information in the forwardingsub-period indicated by the forwarding sub-period label.
 6. The datatransmission method of claim 5, wherein calculating the forwardingsub-period label according to the reception sub-period label isimplemented based on the following formula:y=(x+i)%m_(n), where, y denotes the forwarding sub-period label, xdenotes the reception sub-period label, i denotes a preset naturalnumber, m_(n) denotes a quantity of forwarding sub-periods comprised inthe forwarding period determined according to T_(n), T_(n) denotes theperiod value corresponding to the forwarding sub-period, and % denotes aremainder sign.
 7. The data transmission method of claim 1, whereinacquiring a reception sub-period label according to a time of arrival ofthe message and the second information comprises: determining the periodvalue corresponding to the message according to the second information;and calculating the reception sub-period label according to the periodvalue and the time of arrival.
 8. The data transmission method of claim7, wherein calculating the reception sub-period label according to theperiod value and the time of arrival is implemented based on thefollowing formula:${x = {\left\{ {\left\lbrack \frac{t_{arrive} - t_{start}}{T_{n}} \right\rbrack + 1} \right\}\% m_{n}}},$where x denotes the reception sub-period label, t_(start) denotes apreset value, t_(arrive) denotes the time of arrival, T_(n) denotes theperiod value, m_(n) denotes a quantity of reception sub-periodscomprised in the reception period determined according to T_(n), [ ] inthe formula denotes a rounding sign, and % denotes a remainder sign. 9.An electronic device, comprising: at least one processor; and a memorycommunicably connected to the at least one processor, wherein: thememory stores instructions executable by the at least one processorwhich, when executed by the at least one processor, causes the at leastone processor to perform a data transmission method, comprising:receiving a message sent by an upstream device, wherein the messagecarries first information for indicating an outbound interface andsecond information for indicating a period value; acquiring a receptionsub-period label according to a time of arrival of the message and thesecond information, wherein the reception sub-period label is used forindicating a sequential position of a reception sub-period used when themessage is received in an entire reception period, and the receptionperiod comprises a plurality of reception sub-periods; and sending themessage according to the reception sub-period label and the firstinformation.
 10. A non-transitory computer-readable storage medium,storing a computer program which, when executed by a processor, causesthe processor to perform a data transmission method, comprising:receiving a message sent by an upstream device, wherein the messagecarries first information for indicating an outbound interface andsecond information for indicating a period value; acquiring a receptionsub-period label according to a time of arrival of the message and thesecond information, wherein the reception sub-period label is used forindicating a sequential position of a reception sub-period used when themessage is received in an entire reception period, and the receptionperiod comprises a plurality of reception sub-periods; and sending themessage according to the reception sub-period label and the firstinformation.
 11. The data transmission method of claim 2, whereinsending the message according to the reception sub-period label and thefirst information comprises: recording an inbound interface used whenthe message arrives; determining the outbound interface according to thefirst information; searching for a forwarding sub-period label in thelocal period mapping table according to the reception sub-period label,the inbound interface, and the outbound interface, wherein theforwarding sub-period label is used for indicating a sequential positionof a forwarding sub-period used when the message is forwarded in anentire forwarding period, and the forwarding period comprises aplurality of forwarding sub-periods; and sending the message out fromthe outbound interface in the forwarding sub-period indicated by theforwarding sub-period label.
 12. The data transmission method of claim2, wherein the period generation policy is to acquire the period valueaccording to the second information, and the second information is astream identification number or a 6-tuple of a data packet or apriority.
 13. The data transmission method of claim 3, wherein theperiod generation policy is to acquire the period value according to thesecond information, and the second information is a streamidentification number or a 6-tuple of a data packet or a priority. 14.The data transmission method of claims 2, wherein sending the messageaccording to the reception sub-period label and the first informationcomprises: calculating the forwarding sub-period label according to thereception sub-period label; and sending the message out from theoutbound interface indicated by the first information in the forwardingsub-period indicated by the forwarding sub-period label.
 15. The datatransmission method of claims 3, wherein sending the message accordingto the reception sub-period label and the first information comprises:calculating the forwarding sub-period label according to the receptionsub-period label; and sending the message out from the outboundinterface indicated by the first information in the forwardingsub-period indicated by the forwarding sub-period label.
 16. The datatransmission method of claims 4, wherein sending the message accordingto the reception sub-period label and the first information comprises:calculating the forwarding sub-period label according to the receptionsub-period label; and sending the message out from the outboundinterface indicated by the first information in the forwardingsub-period indicated by the forwarding sub-period label.
 17. The datatransmission method of claim 2, wherein acquiring a reception sub-periodlabel according to a time of arrival of the message and the secondinformation comprises: determining the period value corresponding to themessage according to the second information; and calculating thereception sub-period label according to the period value and the time ofarrival.
 18. The data transmission method of claim 3, wherein acquiringa reception sub-period label according to a time of arrival of themessage and the second information comprises: determining the periodvalue corresponding to the message according to the second information;and calculating the reception sub-period label according to the periodvalue and the time of arrival.
 19. The data transmission method of claim4, wherein acquiring a reception sub-period label according to a time ofarrival of the message and the second information comprises: determiningthe period value corresponding to the message according to the secondinformation; and calculating the reception sub-period label according tothe period value and the time of arrival.
 20. The data transmissionmethod of claim 5, wherein acquiring a reception sub-period labelaccording to a time of arrival of the message and the second informationcomprises: determining the period value corresponding to the messageaccording to the second information; and calculating the receptionsub-period label according to the period value and the time of arrival.